<%
    if(session.getAttribute("KhachHang") == null){
        response.sendRedirect("dangnhap.jsp");
        return;
    }
%>
<%@page import="dto.DTO_KhachHang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>THÔNG TIN KHÁCH HÀNG</title>
         <link type="text/css" rel="stylesheet" href="css/style.css" />
        <link type="text/css" rel="stylesheet" href="css/nivo-slider.css" />
        <link type="text/css" rel="stylesheet" href="css/default/default.css" />
        <script type="text/javascript" src="js/jquery-1.5.2.js"></script>
        <script type="text/javascript" src="js/myJS.js"></script>
        <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
        <s:head/>
    </head>
    <% 
        DTO_KhachHang dtoKH = (DTO_KhachHang)session.getAttribute("KhachHang");
        String gt = "Nam";
        if(dtoKH.getGioiTinh() == 0){
            gt = "Nữ";
            
           
        }

    %>
    <body>
        <div id="top-background">
             <div id="page-container">
                 <jsp:include page="template/header.jsp"></jsp:include>
                 <jsp:include page="template/navigation.jsp"></jsp:include>
                 <div id="main-content">
                     <div id="left-content">
                        <div class="title">
                            <p>Thông tin khách hàng</p>
                        </div>
                        <div id="left-content-inline">
                            <table width="100%">
                                <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Tên đăng nhập : </td><td><p><%= dtoKH.getTenDangNhap() %></p></td>
                                </tr>

                                <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Họ tên : </td><td><p><%= dtoKH.getHoTen() %></p></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Giới tính : </td><td><p><%= gt %></p></td>
                                </tr>
                                 <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Địa chỉ : </td><td><p><%= dtoKH.getDiaChi() %></p></td>
                                </tr>
                                 <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Email : </td><td><p><%= dtoKH.getEmail() %></p></td>
                                </tr>
                                 <tr>
                                    <td style="text-align: right;padding-right: 50px;width: 200px;">Điện thoại : </td><td><p><%= dtoKH.getDienThoai() %></p></td>
                                </tr>
                            </table>
                            <table>
                                <tr>
                                    <td colspan="2"><h2>Cập nhật thông tin</h2></td>
                                </tr>
                                <tr>
                                    <td>
                                        <s:form action="CapNhat" method = "POST" >
                                            <s:textfield name = "hoten" cssStyle="height:25px;width:200px;" maxLength="50" label = "Họ tên"/>
                                            <s:radio name="gioitinh" list="#{'1':'Nam','2':'Nữ'}" value="1"  label = "Giới tính" />
                                            <s:textfield name = "diachi" cssStyle="height:25px;width:200px;" maxLength="100" label = "Địa chỉ"/>
                                            <s:textfield name = "email" cssStyle="height:25px;width:200px;" maxLength="50" label = "Email"/>
                                            <s:textfield name = "dienthoai" cssStyle="height:25px;width:200px;" maxLength="11" label = "Điện thoại"/>
                                            <s:submit value = "Cập nhật" method="execute" cssStyle="height:45px;float:left;width:100px;margin-left:170px;"/>
                                        </s:form>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-left: 170px;">
                                        <p style="color:red;"><s:actionerror/></p>
                                    </td>
                                    <td>
                                         
                                    </td>
                                </tr>
                            </table>
                        </div>
                     </div>
                     <jsp:include page="template/right_content.jsp"></jsp:include>
                 </div>
                 <div style="clear: both;"></div>
                 <jsp:include page="template/footer.jsp"></jsp:include>
             </div>
        </div>
    </body>
</html>
